package com.apes.hr.base.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.hr.base.model.Job;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @author HuJianLin
 * @create 2018-04-28 16:07
 */
public interface JobRepository extends CustomRepository<Job, String>{

    @Query("select T from Job T where 1 = 1 and valid = 1 and (id like %:value%  or name like %:value%) ")
    Page<Job> find(@Param("value") String value, Pageable pageable);
}
